#ifndef CGCOLOR_H
#define CGCOLOR_H

class CgColor
{
public:
    CgColor();
    CgColor(double r, double g, double b);
    CgColor(const CgColor &c);
    CgColor& operator=(const CgColor &c);

    inline double r() const { return r_; }
    inline double g() const { return g_; }
    inline double b() const { return b_; }
    inline void set_r(double r) { r_ = r; }
    inline void set_g(double g) { g_ = g; }
    inline void set_b(double b) { b_ = b; }
    void sanitize();
private:
    double r_, g_, b_;
};

CgColor operator+(const CgColor &a, const CgColor &b);
CgColor operator-(const CgColor &a, const CgColor &b);
CgColor operator*(const CgColor &a, const CgColor &b);
CgColor operator*(double s, const CgColor &c);

#endif // CGCOLOR_H
